﻿package plugin.chatflash.controller
{
    import com.core.*;
    import com.sh.game.util.*;
    import pluginfw.*;

    public class ChatWDContent extends Object
    {

        public function ChatWDContent()
        {
            return;
        }// end function

        public static function getContent(param1:Array) : String
        {
            var announceID:int;
            var item:Object;
            var arr:Array;
            var npc:Object;
            var guanwei:Object;
            var skill:Object;
            var pluginName:String;
            var jingmai:Object;
            var horseLevel:int;
            var horseStar:int;
            var wingLevel:int;
            var wingStar:int;
            var itemList:Array;
            var nameList:Array;
            var data:String;
            var tempNameList:Array;
            var tempData:String;
            var cfg_Ring:Object;
            var ringname:String;
            var tjinstance:Array;
            var cfgtj:Object;
            var item2:Object;
            var item3:Object;
            var item4:Object;
            var obj:Object;
            var startStyle:String;
            var endStyle:String;
            var styleFun:Function;
            var itemFun:Function;
            var string:String;
            var item5:Object;
            var configsArr:Array;
            var plus:String;
            var fashionArr:Object;
            var wing:Object;
            var jade:Object;
            var ringobj:Object;
            var tjobj:Object;
            var value:* = param1;
            var content:String;
            announceID;
            var replace:Array;
            switch(value[0])
            {
                case 1:
                {
                    announceID;
                    replace;
                    break;
                }
                case 2:
                {
                    break;
                }
                case 3:
                {
                    announceID;
                    replace;
                    break;
                }
                case 4:
                {
                    announceID;
                    replace;
                    break;
                }
                case 5:
                {
                    announceID;
                    replace;
                    break;
                }
                case 6:
                {
                    announceID;
                    replace;
                    break;
                }
                case 7:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    announceID;
                    replace;
                    break;
                }
                case 8:
                {
                    item = ConfigDictionary.data.item[value[4]];
                    announceID;
                    replace;
                    break;
                }
                case 9:
                {
                    announceID;
                    replace;
                    break;
                }
                case 10:
                {
                    announceID;
                    replace;
                    break;
                }
                case 11:
                {
                    announceID;
                    replace;
                    break;
                }
                case 12:
                {
                    item = ConfigDictionary.data.item[207405];
                    announceID;
                    replace;
                    break;
                }
                case 13:
                {
                    announceID;
                    replace;
                    break;
                }
                case 14:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    announceID;
                    replace;
                    break;
                }
                case 15:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    pluginName;
                    switch(value[5])
                    {
                        case 1:
                        {
                            pluginName;
                            break;
                        }
                        case 2:
                        {
                            pluginName;
                            break;
                        }
                        case 3:
                        {
                            pluginName;
                            break;
                        }
                        case 4:
                        {
                            pluginName;
                            break;
                        }
                        default:
                        {
                            break;
                        }
                    }
                    announceID;
                    replace;
                    break;
                }
                case 16:
                {
                    jingmai = ConfigDictionary.data.jmadd[value[3]][1];
                    announceID;
                    replace;
                    break;
                }
                case 17:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    announceID;
                    replace;
                    break;
                }
                case 18:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    announceID;
                    replace;
                    break;
                }
                case 19:
                {
                    announceID;
                    replace;
                    break;
                }
                case 20:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    announceID;
                    replace;
                    break;
                }
                case 21:
                {
                    announceID;
                    replace;
                    break;
                }
                case 22:
                {
                    announceID;
                    replace;
                    break;
                }
                case 23:
                {
                    announceID;
                    replace;
                    break;
                }
                case 24:
                {
                    announceID;
                    replace;
                    break;
                }
                case 25:
                {
                    skill = ConfigDictionary.data.skill[value[3]];
                    announceID;
                    replace;
                    break;
                }
                case 28:
                {
                    announceID;
                    replace;
                    break;
                }
                case 29:
                {
                    announceID;
                    replace;
                    break;
                }
                case 30:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    announceID;
                    replace;
                    break;
                }
                case 31:
                {
                    announceID;
                    replace;
                    break;
                }
                case 32:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[4]];
                    replace;
                    break;
                }
                case 33:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[4]];
                    horseLevel = (int(value[3] / 10) + 1);
                    horseStar = int(value[3] % 10);
                    replace;
                    break;
                }
                case 34:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[4]];
                    wingLevel = (int(value[3] / 10) + 1);
                    wingStar = int(value[3] % 10);
                    replace;
                    break;
                }
                case 35:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    break;
                }
                case 36:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    break;
                }
                case 37:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    break;
                }
                case 38:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    break;
                }
                case 39:
                {
                    announceID;
                    itemList;
                    item = ConfigDictionary.data.item[itemList[(int(value[3]) - 1)]];
                    nameList;
                    data;
                    if (value[3] == 5)
                    {
                        data;
                    }
                    else
                    {
                        data = StringUtil.substitute("{0}#{1}", 2, ConfigDictionary.data.testactive[value[3]].state);
                    }
                    replace;
                    break;
                }
                case 40:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[4]];
                    tempNameList;
                    tempData;
                    if (value[3] == 5)
                    {
                        tempData;
                    }
                    else
                    {
                        tempData = StringUtil.substitute("{0}#{1}", 2, ConfigDictionary.data.testactive[value[3]].state);
                    }
                    replace;
                    break;
                }
                case 41:
                {
                    announceID;
                    item = ConfigDictionary.data.item[207120];
                    replace;
                    break;
                }
                case 42:
                {
                    announceID;
                    item = ConfigDictionary.data.item[207584];
                    replace;
                    break;
                }
                case 43:
                {
                    announceID;
                    item = ConfigDictionary.data.item[207308];
                    replace;
                    break;
                }
                case 44:
                {
                    announceID;
                    cfg_Ring = ConfigDictionary.data.specialRing;
                    ringname;
                    var _loc_3:int = 0;
                    var _loc_4:* = cfg_Ring;
                    while (_loc_4 in _loc_3)
                    {
                        
                        ringobj = _loc_4[_loc_3];
                        if (ringobj.ringid == value[3])
                        {
                            ringname = ringobj.name;
                            break;
                        }
                    }
                    replace;
                    break;
                }
                case 45:
                {
                    announceID;
                    tjinstance = ConfigDictionary.data.tjinstance;
                    var _loc_3:int = 0;
                    var _loc_4:* = tjinstance;
                    while (_loc_4 in _loc_3)
                    {
                        
                        tjobj = _loc_4[_loc_3];
                        if (tjobj.instid == value[3])
                        {
                            cfgtj = tjobj;
                            break;
                        }
                    }
                    replace;
                    break;
                }
                case 46:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[3]];
                    item2 = ConfigDictionary.data.item[value[4]];
                    replace;
                    break;
                }
                case 47:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    break;
                }
                case 48:
                {
                    announceID;
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    break;
                }
                case 49:
                {
                    announceID;
                    item3 = ConfigDictionary.data.item[value[3]];
                    item4 = ConfigDictionary.data.item[value[4]];
                    replace;
                    break;
                }
                case 50:
                {
                    announceID;
                    obj = ConfigDictionary.data.announce[announceID];
                    arr = String(obj.text).split("{5}");
                    startStyle = arr[0];
                    endStyle = arr[1];
                    styleFun = function (param1:Array, param2:int = 5) : String
            {
                var _loc_3:* = startStyle;
                _loc_3 = _loc_3 + ("<font color=\'{" + param2 + "}\'><u><a href=\'event:item|2|{" + ((param2 + 1)).toString() + "}\'>{" + (param2 + 2).toString() + "}</a></u></font>");
                var _loc_4:* = param1.length;
                var _loc_5:int = 1;
                while (_loc_5 < _loc_4)
                {
                    
                    param2 = param2 + 3;
                    _loc_3 = _loc_3 + ("、<font color=\'{" + param2 + "}\'><u><a href=\'event:item|2|{" + ((param2 + 1)).toString() + "}\'>{" + (param2 + 2).toString() + "}</a></u></font>");
                    _loc_5++;
                }
                _loc_3 = _loc_3 + endStyle;
                return _loc_3;
            }// end function
            ;
                    itemFun = function (param1:Array) : Array
            {
                var _loc_6:Object = null;
                var _loc_2:Array = [];
                var _loc_3:* = param1.length;
                var _loc_4:int = 0;
                var _loc_5:int = 0;
                while (_loc_5 < _loc_3)
                {
                    
                    if (param1[_loc_5] > 0)
                    {
                        _loc_6 = ConfigDictionary.data.item[param1[_loc_5]];
                        _loc_2[_loc_4] = MColor.getqualitycolor(_loc_6.quality);
                        _loc_2[(_loc_4 + 1)] = _loc_6.itemid;
                        _loc_2[_loc_4 + 2] = _loc_6.name;
                        _loc_4 = _loc_4 + 3;
                    }
                    _loc_5++;
                }
                return _loc_2;
            }// end function
            ;
                    arr = value[4].source;
                    string = ChatWDContent.styleFun(arr, 5);
                    arr = ChatWDContent.itemFun(arr);
                    item5 = ConfigDictionary.data.item[value[3]];
                    replace;
                    replace = replace.concat(arr);
                    content = StringUtil.substitute(string.replace(/\|""\|/gi, ","), replace);
                    return content;
                }
                case 51:
                {
                    configsArr;
                    plus;
                    if (value[4] == 2)
                    {
                        item = ConfigDictionary.data.skill[value[3]];
                        configsArr[0] = "skill,2,";
                        configsArr[1] = "#ff6600";
                        configsArr[2] = item.skillid;
                    }
                    else
                    {
                        item = ConfigDictionary.data.item[value[3]];
                        configsArr[0] = "item,2,";
                        configsArr[1] = MColor.getqualitycolor(item.quality);
                        configsArr[2] = item.itemid;
                        plus = item.uselv + "级";
                    }
                    announceID;
                    replace;
                    break;
                }
                case 52:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 53:
                {
                    announceID;
                    break;
                }
                case 54:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 55:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 56:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 57:
                {
                    replace;
                    announceID;
                    break;
                }
                case 58:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    fashionArr;
                    replace;
                    announceID;
                    break;
                }
                case 59:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 60:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 61:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 62:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 63:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 64:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 65:
                {
                    replace;
                    announceID;
                    break;
                }
                case 66:
                {
                    replace;
                    announceID;
                    break;
                }
                case 67:
                {
                    guanwei = ConfigDictionary.data.guanwei[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 68:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 69:
                {
                    replace;
                    announceID;
                    break;
                }
                case 70:
                {
                    replace;
                    announceID;
                    break;
                }
                case 71:
                {
                    replace;
                    announceID;
                    break;
                }
                case 72:
                {
                    replace;
                    announceID;
                    break;
                }
                case 73:
                {
                    replace;
                    announceID;
                    break;
                }
                case 74:
                {
                    replace;
                    announceID;
                    break;
                }
                case 75:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 76:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 77:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 78:
                {
                    replace;
                    announceID;
                    break;
                }
                case 79:
                {
                    replace;
                    announceID;
                    break;
                }
                case 80:
                {
                    replace;
                    announceID;
                    break;
                }
                case 81:
                {
                    replace;
                    announceID;
                    break;
                }
                case 82:
                {
                    announceID;
                    break;
                }
                case 83:
                {
                    replace;
                    announceID;
                    break;
                }
                case 84:
                {
                    replace;
                    announceID;
                    break;
                }
                case 85:
                {
                    replace;
                    announceID;
                    break;
                }
                case 86:
                {
                    replace;
                    announceID;
                    break;
                }
                case 87:
                {
                    announceID;
                    break;
                }
                case 88:
                {
                    replace;
                    announceID;
                    break;
                }
                case 89:
                {
                    replace;
                    announceID;
                    break;
                }
                case 90:
                {
                    replace;
                    announceID;
                    break;
                }
                case 91:
                {
                    replace;
                    announceID;
                    break;
                }
                case 92:
                {
                    item = ConfigDictionary.data.item[value[5]];
                    replace;
                    announceID;
                    break;
                }
                case 93:
                {
                    npc = ConfigDictionary.data.sysnpc[151];
                    replace;
                    announceID;
                    break;
                }
                case 94:
                {
                    npc = ConfigDictionary.data.sysnpc[149];
                    replace;
                    announceID;
                    break;
                }
                case 95:
                {
                    npc = ConfigDictionary.data.sysnpc[232];
                    replace;
                    announceID;
                    break;
                }
                case 96:
                {
                    npc = ConfigDictionary.data.sysnpc[192];
                    replace;
                    announceID;
                    break;
                }
                case 97:
                {
                    replace;
                    announceID;
                    break;
                }
                case 98:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 99:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 100:
                {
                    wing = ConfigDictionary.data.wing[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 101:
                {
                    guanwei = ConfigDictionary.data.guanwei[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 102:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    jade = ConfigDictionary.data.jade[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 103:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 104:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 105:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 106:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 107:
                {
                    skill = ModelProxy.getValue("data", "configs").skill[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 108:
                {
                    replace;
                    announceID;
                    break;
                }
                case 109:
                {
                    npc = ConfigDictionary.data.sysnpc[192];
                    replace;
                    announceID;
                    break;
                }
                case 110:
                {
                    replace;
                    announceID;
                    break;
                }
                case 111:
                {
                    npc = ConfigDictionary.data.sysnpc[121];
                    replace;
                    announceID;
                    break;
                }
                case 112:
                {
                    npc = ConfigDictionary.data.sysnpc[149];
                    replace;
                    announceID;
                    break;
                }
                case 113:
                {
                    npc = ConfigDictionary.data.sysnpc[232];
                    replace;
                    announceID;
                    break;
                }
                case 114:
                {
                    replace;
                    announceID;
                    break;
                }
                case 115:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 116:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 117:
                {
                    replace;
                    announceID;
                    break;
                }
                case 118:
                {
                    replace;
                    announceID;
                    break;
                }
                case 119:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 120:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 121:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 122:
                {
                    item = ConfigDictionary.data.item[value[3]];
                    replace;
                    announceID;
                    break;
                }
                case 123:
                {
                    replace;
                    announceID;
                    break;
                }
                case 124:
                {
                    replace;
                    announceID;
                    break;
                }
                case 125:
                {
                    replace;
                    announceID;
                    break;
                }
                case 126:
                {
                    replace;
                    announceID;
                    break;
                }
                case 127:
                {
                    replace;
                    announceID;
                    break;
                }
                case 128:
                {
                    replace;
                    announceID;
                    break;
                }
                case 129:
                {
                    replace;
                    announceID;
                    break;
                }
                case 130:
                {
                    announceID;
                    break;
                }
                case 131:
                {
                    replace;
                    announceID;
                    break;
                }
                case 132:
                {
                    npc = ConfigDictionary.data.sysnpc[258];
                    replace;
                    announceID;
                    break;
                }
                case 133:
                {
                    npc = ConfigDictionary.data.sysnpc[258];
                    replace;
                    announceID;
                    break;
                }
                case 134:
                {
                    replace;
                    announceID;
                    break;
                }
                case 135:
                {
                    replace;
                    announceID;
                    break;
                }
                case 136:
                {
                    replace;
                    announceID;
                    break;
                }
                case 137:
                {
                    replace;
                    announceID;
                    break;
                }
                default:
                {
                    return "本信息为空：原因不存在协议" + value[0];
                    break;
                }
            }
            if (announceID == 233)
            {
                if (UserData.getUserData("level") < 65)
                {
                    return null;
                }
            }
            var announce:* = ConfigDictionary.data.announce[announceID];
            if (announce)
            {
                content = StringUtil.substitute(String(announce.text).replace(/\|""\|/gi, ","), replace);
            }
            return content;
        }// end function

    }
}
